package org.example.designpatterns.singleton.demo7;

import java.math.BigDecimal;
import java.math.RoundingMode;

public class Main {
    public static void main(String[] args) {
        BigDecimal bigDecimal = BigDecimal.valueOf(3.14);
        System.out.println(bigDecimal.setScale(1, RoundingMode.HALF_UP));//3.1
        System.out.println(bigDecimal);

        bigDecimal = BigDecimal.valueOf(3.15);
        System.out.println(bigDecimal.setScale(1, RoundingMode.HALF_UP));//3.2
        System.out.println(bigDecimal);
    }
}
